﻿	      <?php  include("conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
public $zongjia;

	function __construct($zongjia)
	{
		$this->zongjia    = $zongjia;
	}
}
if($_REQUEST[d]==1)
{
$states=0;
$state3=3;
 $srat=mysql_query("update car set state='".$state3."' where userid='".$_REQUEST[userid]."' and state='".$states."'");
$zongj=0;

	$rert30=mysql_query("select *from car where userid='".$_REQUEST[userid]."' and state='".$state3."' ");
	
	while($rowf=mysql_fetch_array($rert30)){
	
	$zongj=$zongj+$rowf[price]*$rowf[number];
	
	}
}
else
{
$state1=1;
$state3=3;
 $srat=mysql_query("update car set state='".$state1."' where userid='".$_REQUEST[userid]."' and state='".$state3."'");
	
 $zongj=0;	
 
}
	

$prize = array();
	
	
$prize[] = new MyPrizeBean($zongj);
		


echo json_encode($prize);


?>